<#assign nojs=true>
<#include "/WEB-INF/default/fragment/header.ftl">
<body>

<script type="text/javascript" src="${request.contextPath}/assets/js/jquery.js"></script>
<script src="//cdn.bootcss.com/moment.js/2.10.6/moment.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/assets/js/bootstrap.min.js"></script>

<#include "/WEB-INF/default/fragment/nav.ftl">

<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker-standalone.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="//cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>

<style>
.legend {
  border-bottom: 1px solid red;
  padding: 0px;
}
fieldset {
  width: 80%;
  margin: 0 auto;
}
</style>
<div class="container">
  <div class="tms-logo"><img class="center-block" src="${request.contextPath}/assets/images/logo.png" alt=""></div>
</div>

<div class="container">
<form class="form-horizontal" action="${request.contextPath}/task-list.action" method="get">
  <input type="hidden" class="form-control" name="team.id" value="<#if team?? && team.id??>${team.id}</#if>">

  <legend class="clearfix">
    <div class="pull-left"><h4>${team.name}${project.title}的任务列表</h4></div>
    <div class="pull-right">
      <a href="${request.contextPath}/team-${team.id}.action" class="btn btn-success">团队首页</a>
    </div>
  </legend>
  <div>
    <table class="table">
      <thead>
        <tr>
          <th>任务id</th>
          <th>任务名称</th>
          <th>开始、结束时间</th>
          <th>附件</th>
          <th></th>
        </tr>
      </thead>
      <tbody>
        <#list tasks as task>
        <tr>
          <td>${task.id}</td>
          <td>${task.title}</td>
          <td>${(task.gmtStart*1000)?number_to_datetime}、${(task.gmtFinished*1000)?number_to_datetime}<#if (task.gmtFinished-now) lt 0>已结束<#else>（剩余${((task.gmtFinished-now)/60/60)?floor}小时）</#if></td>
          <td><a href="${task.attachmentUrl}">${task.attachmentUrl}</a></td>
          <td class="btn-group-xs"><a class="btn btn-primary btn-xs" href="${request.contextPath}/task-detail.action?task.id=${task.id}">详情</a></td>
        </tr>
        <#else>
        <tr>
          <td colspan="5">您还没有给项目发布过任务，请<a href="${request.contextPath}/team-${team.id}.action">返回团队首页</a>再创建任务</td>
        </tr>
        </#list>
      </tbody>
    </table>
  </div>
</form>
</div>

</body>
<#include "/WEB-INF/default/fragment/footer.ftl">
